KERNEL_VER=$(shell uname -r)
CUR_DIR=$(shell pwd)

ARCH?=arm64
CROSS_PATH?=gcc_path
CROSS_COMPILE?=$(CROSS_PATH)/aarch64-none-linux-gnu-
KERNEL_DIR?=linux_dor


src_dir?= $(shell pwd)
export src_dir
includedir:= -I$(src_dir) 
EXTRA_CFLAGS += -g -O2 $(includedir) -DDEBUG=0 -DTRBE_MEM_BASE=0x200000000 -DTRBE_MEM_PERCPU_SIZE=0x2000000

MODULE_NAME=core_trace

obj-m += $(MODULE_NAME).o
$(MODULE_NAME)-objs +=	coresight_core.o coresight_smp.o

ko:
	make -C $(KERNEL_DIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(CUR_DIR) modules

clean:
	make -C $(KERNEL_DIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(CUR_DIR) clean